package com.zyh.demo;

import java.util.Arrays;

public class StringDemo1 {
    public static void main(String[] args) {
        String str="hello java";
        String[] str1 = str.split(" ");
        System.out.println(Arrays.toString(str1));
        char[] chs = str.toCharArray();
        System.out.println(Arrays.toString(chs));
        String str2 = str.toUpperCase();
        System.out.println("str2 = " + str2);
        byte[] bytes = str2.getBytes();
        System.out.println(Arrays.toString(bytes));
        int start = str.indexOf('j');
        int end = str.indexOf('a');
        String substring = str.substring(start, end + 1);
        System.out.println("substring = " + substring);
        String replace = str.replace('l','$');
        System.out.println("replace = " + replace);

    }
}
